﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Backup.Services.Entities;
using BackupObjects.Taging;
using NUnit.Framework;

namespace Backup.Services.Tests
{
    [TestFixture]
    class TagEntityTest
    {
        [Test]
        public void TagToTagEntityTest()
        {
            Tag tag = new Tag() {Id = Guid.NewGuid(), Name = "Name"};
            TagEntity tagEntity = tag;

            Assert.IsNotNull(tagEntity,"Entity is null");
            Assert.AreEqual(tag.Id,tagEntity.Id,"The id is not the same.");
            Assert.AreEqual(tag.Name, tagEntity.Name,"The name is not the same.");
        }

        [Test]
        public void TagToTagEntityNullTest()
        {
            Tag tag = null;
            TagEntity tagEntity = tag;

            Assert.IsNull(tagEntity, "Entity is not null");
        }

        [Test]
        public void TagEntityToTagTest()
        {
            TagEntity tagEntity = new TagEntity() { Id = Guid.NewGuid(), Name = "Name" };
            Tag tag = tagEntity;

            Assert.IsNotNull(tag, "Entity is null");
            Assert.AreEqual(tagEntity.Id, tag.Id, "The id is not the same.");
            Assert.AreEqual(tagEntity.Name,tag.Name, "The name is not the same.");
        }

        [Test]
        public void TagEntityToTagNullTest()
        {
            TagEntity tagEntity = null;
            Tag tag = tagEntity;

            Assert.IsNull(tag, "Entity is not null");
        }
    }
}
